
import '../../network/http_entity.dart';

class SuggestionSearchEntityList {
  final List<SuggestionSearchEntity> listSuggestionEntity;
  final int? pageCurrent;
  final int? pageSize;
  final int? total;
  final bool? hasNext;
  final int? pages;
  SuggestionSearchEntityList({
    required this.listSuggestionEntity,
    this.pageCurrent,
    this.pageSize,
    this.total,
    this.hasNext,
    this.pages,
  });

  factory SuggestionSearchEntityList.fromJson(List<dynamic> json, dynamic result) {
    // HttpEntity httpEntity = result;
    List<SuggestionSearchEntity> imageTexts = json.map<SuggestionSearchEntity>((item) {

      return SuggestionSearchEntity(
        videoid: item['videoid'],
        type: item['type'],
        title: item['title'],
        imageTextId: item['imageTextId']
        // 其他属性...
      );
    }).toList();

    return SuggestionSearchEntityList(
        listSuggestionEntity: imageTexts,
        // pageCurrent : httpEntity.oriData['pageCurrent'],
        // pageSize : httpEntity.oriData['pageSize'],
        // total : httpEntity.oriData['total'],
        // hasNext : httpEntity.oriData['hasNext'],
        // pages : httpEntity.oriData['pages']
      // 其他属性...
    );
  }


  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (listSuggestionEntity != null) {
      map['list'] = listSuggestionEntity?.map((v) => v.toJson()).toList();
    }
    map['pageCurrent'] = pageCurrent;
    map['pageSize'] = pageSize;
    map['total'] = total;
    map['hasNext'] = hasNext;
    map['pages'] = pages;
    return map;
  }
}
class SuggestionSearchEntity {
  final String videoid;
  final String type;
  final String title;
  final int imageTextId;
  SuggestionSearchEntity( {required this.videoid, required this.type, required this.title,required this.imageTextId});
  Map<String, dynamic> toJson() {
    return {
      'videoid': videoid,
      'title': title,
      'type': type,
      'imageTextId': imageTextId
    };
  }

  factory SuggestionSearchEntity.fromJson(Map<String, dynamic> json) {
    return SuggestionSearchEntity(
        videoid: json['videoid'],
        title: json['title'],
        type: json['type'],
        imageTextId: json['imageTextId']
    );
  }

}